<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>东莞新华投票系统v1.0</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="./js/jquery-1.5.2.js"></script>
</head>
<body>
	<?php
		if(!isset($_COOKIE['islogin']) || $_COOKIE['islogin']!=1){
        echo "<script>window.location.href='login.php';</script>";
    	}

    require('config.php');
    $account = $_COOKIE['username'];
    $select_query = "select vsID,title,deadDate,state from vote_subject where vsID not in (select vsID from user_vs where account='$account') and state='进行中'";
    $result_select_notice = mysql_query("select content from notice");
    $row_notice = mysql_fetch_row($result_select_notice);
    $result_select = mysql_query($select_query) or die(mysql_error());
    $select_query_passwd = mysql_query("select pass from users where account='$account'");
    $result_select_passwd  =mysql_fetch_row($select_query_passwd);
    if($result_select_passwd[0]=="123456"){
        echo "<script> alert('亲，请修改初始密码后再登陆！'); window.location.href='rep-password.php';</script>";

    }
	?>
	<div id="nav">
		<div id="nav_top">
			<div class="width navs">
					<div class="logo">
						<a href="index.php" target="ifm"><img src="images/logo.png" width="290" height="54" /></a>
					</div>
					<div class="clear"></div>
			</div>
		</div>
		<div id="header">
			<div class="width">
				<div style="background: url(images/gx.gif) no-repeat; height: 48px;">
					<span style="float: right; font-size: 12px;">欢迎您：<?php echo $_COOKIE["username"];?>---<a href="rep-password.php?action=<?php echo $_COOKIE['username'];?>">修改密码</a>---<a href="login.php?action=logout">退出</a></span>
					<div id="top-nav">
					<a id="1" href="index.php" class="curr">首页</a> 
					<a id="2" href="my-vote.php">我的投票</a> 
					<a id="3" href="create-vote.php">创建投票</a> 
					<a id="4" href="manager-vote.php">管理投票</a> 
					</div>
				</div>
			</div>
		</div>
	</div>
<div id="main_banner">
	</div>
	<!--详细内容模块start-->
	<div id="content">
		<div class="width">
			<!--详细内容模块左侧start-->

			<div id="content_left">
				<div>
					<div class="yjbg_top">
						<h1>最新投票目录</h1>
					</div>
					<div class="center">
                        <table>
                            <tr>
                                <th width="50">序号</th>
                                <th width="330">主题</th>
                                <th width="100">截止日期</th>
                                <th width="60">状态</th>
                                <th width="60">操作</th>
                            </tr>
                            <?php
                            $num = 0;
                            while($row=mysql_fetch_array($result_select)){
                                $num++;
                            ?>
                            <tr>
                                <td><?php echo $num;?></td>
                                <td><?php echo $row['title'];?></td>
                                <td><?php echo $row['deadDate'];?></td>
                                <td><?php echo $row['state'];?></td>
                                <td><a href="dovote.php?action=<?php echo $row['vsID'];?>">投票</a></td>
                            </tr>
                            <?php
                            }
                            ?>
                        </table>
					</div>
					<div class="yjbg_bottom"></div>
				</div>

			</div>
			<!--详细内容模块左侧end-->
			<!--详细内容模块右侧start-->
			<div id="content_right">
				<div class="loginsh">
					<div class="yjbgright_top"></div>
					<div class="yjbgright_conter">
					<h3>系统公告</h3>
                    <p><?php echo $row_notice[0]; ?></p>
                    </div>
					<div class="yjbgright_bottom"></div>
				</div>
			</div>
			<!--详细内容模块右侧end-->
			<div class="clear"></div>
		</div>
	</div>
	<!--详细内容模块end-->
	<div id="footer">
		<div
			style="background: url(images/gx_footer.gif) no-repeat; width: auto; height: 118px; padding: 20px 0 0 0;">
			<div class="width">
				<div style="text-align: center; font-size: 14px;">
					<a href="http://10.44.152.49">东莞新华导航页</a> <a
						href="http://10.44.152.252./purchase" class="a1" target="ifm">采购立项签报系统</a> <a
						href="http://10.44.152.166:8080/che/">用车管理系统</a> <a href="http://10.44.152.166:8080/caigou/"
						>采购随机筛选系统</a>
				</div>
				<div
					style="margin: 15px 0 0 0; font-size: 11px; text-align: center;">新华人寿保险股份有限公司东莞中心支公司
					版权所有 东莞新华办公室
                </div>
			</div>
		</div>
	</div>
</body>
</html>
